/**
 * 模拟除法就行了, 这里不用考虑什么效率的
**/
#include <bits/stdc++.h>
using namespace std;
int zheng = 0;
// 只保留n位小数的除法
string divide(int a, int b, int n)
{
    zheng += a / b;
    a = (a % b) * 10;
    string ans;
    for(int i = 1; i <= n; ++i)
    {
        ans.append(1, (a/b) + '0');
        a = (a % b) * 10; 
    }
    return ans;
}

/**
 * n 位小数相加
 */
string add(string lhs, string rhs)
{
    int len = lhs.size();
    int carry = 0;
    string ans(len, 'x');
    for(int i = len - 1; i >= 0; --i)
    {
        int t = (lhs[i] - '0') + (rhs[i] - '0') + carry;
        ans[i] = (t % 10) + '0';
        carry = t / 10;
    }
    zheng += carry;
    return ans;
}

void handle_carry(string &a, int n)
{
    if(n >= 1000) return;
    
    int carry = 0;
    if(a[n] >= '5') carry = 1;
    int i = n - 1;
    while(carry > 0 && i >= 0)
    {
        int t = (a[i] - '0' ) + carry;
        a[i] = (t % 10) + '0';
        carry /= 10;
        i--;
    }
    zheng += carry;
}

int main()
{
#ifdef LOCAL
    freopen("ALGO-246.in", "r", stdin);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int x, y, z, x1, y1, z1, n;
    cin >> x >> y >> z >> x1 >> y1 >> z1 >> n;
    string time1 = divide(x1, x, 1000);
    string time2 = divide(y1, y, 1000);
    string time3 = divide(z1, z, 1000);
    string t1 = add(time1, time2);
    string ans = add(time3, t1);
    handle_carry(ans, n);
    cout << zheng  << "." << ans.substr(0, n) << endl;
    return 0;
}